#include "IDCard.h"
#include "IDCardFactory.h"
#include "Television.h"
#include "TelevisionFactory.h"

int main ()
{
    /* step_1 build product factory */
    Framework::Factory* factory = new IDCard::IDCardFactory();

    /* step_2 create products */
    Framework::Product* p_card1 = factory->create("cooder");
    Framework::Product* p_card2 = factory->create("小红");
    auto p_card3 = factory->create("小白");

    /* step_3 use the product */
    p_card1->use();
    p_card2->use();
    p_card3->use();


    /* make other product */
    /* this factory is differ from IDCardFactory */
    auto fac_tele = new Television::TelevisionFactory();
    auto p_tele1 = fac_tele->create("huawei T18");
    p_tele1->use();

    delete p_tele1;
    return 0;
}